package com.teaching.teachingsupport.mapper.teacherviewmapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.teaching.teachingsupport.common.pojo.dataobject.TeachingClass;
import com.teaching.teachingsupport.common.pojo.dto.response.TeachingClassResponse;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import java.util.List;

@Mapper
public interface TeachingClassMapper extends BaseMapper<TeachingClass> {
    @Select("SELECT " +
            "teaching_class_id as teachingClassId, " +
            "class_name as className, " +
            "semester_id as semesterId, " +
            "grade as grade " +
            "FROM teaching_class " +
            "WHERE teacher_id = #{teacherId} AND course_id = #{courseId}")
    List<TeachingClassResponse> findByTeacherIdAndCourseId(Long teacherId, Long courseId);

    @Select("SELECT student_id FROM student_class WHERE class_id = #{teachingClassId} AND status = 1")
    List<Long> findStudentIdsByClassId(Long teachingClassId);
} 